package com.orm.analysis.service.impl;

import com.orm.analysis.dao.impl.OrderDetailDAO;
import com.orm.analysis.model.OrderDetail;
import com.orm.analysis.service.GenericService;

import java.io.IOException;
import java.text.ParseException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: saman
 * Date: 10/12/13
 * Time: 7:29 AM
 * To change this template use File | Settings | File Templates.
 */
public class OrderDetailService implements GenericService<OrderDetail> {


    private OrderDetailDAO dao;


    public OrderDetailDAO getDao() {
        return dao;
    }

    public void setDao(OrderDetailDAO dao) {
        this.dao = dao;
    }

    public OrderDetail create(OrderDetail entity) {
        dao.save(entity);
        return entity;
    }



    public void delete(Object id) {

        dao.delete(id);
    }
    public OrderDetail update(OrderDetail entity) {
        dao.update(entity);
          return entity;
      }

    public List<OrderDetail> list(int page, int size) {
        return dao.list(page,size);
          }

    public List<OrderDetail> listByFields(String... fieldsNamesValues) {
        StringBuffer queryString= new StringBuffer("select a from OrderDetail a ");
            return dao.listByFields(queryString,fieldsNamesValues);


    }

    public List<OrderDetail> findAllWithDepth(String... fetchRelations) {
                return dao.findAllWithDepth(OrderDetail.class,fetchRelations);
            }

            public OrderDetail findWithDepth(String pkFieldName, Object id, String... fetchRelations) {
                return dao.findWithDepth(OrderDetail.class,pkFieldName,id,fetchRelations);
            }

    public  int updateExecuteUpdateByQuery(String query){
        return dao.updateExecuteUpdateByQuery(query);
    }

    public OrderDetail getById(OrderDetail entity) {
        return dao.getById(entity.getOrderDetailId());
            }

    public OrderDetail getById(Integer id) {
        return dao.getById(id);
       }

    public void executeImproter() throws ParseException, IOException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<Integer> getIdList() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public void processTaskExecutor() {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<OrderDetail> getByIdList(Integer[] entityIdList) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
}
